package com.example.shop.persistence.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.example.shop.config.swagger.IgnoreSwaggerParameter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 首页商品促销分类表
 * </p>
 *
 * @author jason
 * @since 2020-06-15
 */
@Data
@TableName("shop_index_sales")
public class IndexSales extends Model<IndexSales> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 商品销售促销分类名称
     */
    @ApiModelProperty(value="商品销售促销分类名称")
    private String name;

    /**
     * 商品ID集合
     */
    @ApiModelProperty(value="商品ID集合")
    @TableField("goodsIDS")
    private String goodsIDS;

    /**
     * 状态：0 不显示  1显示
     */
    @ApiModelProperty(value="状态：0 不显示  1显示")
    private Integer state;

    /**
     * 商品表 不显示字段
     */
    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    @IgnoreSwaggerParameter
    private List<Goods> goodsList;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGoodsIDS() {
        return goodsIDS;
    }

    public void setGoodsIDS(String goodsIDS) {
        this.goodsIDS = goodsIDS;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "IndexSales{" +
        "id=" + id +
        ", name=" + name +
        ", goodsIDS=" + goodsIDS +
        ", state=" + state +
        "}";
    }
}
